Skip to main content

Class: BigNumber

Implements

  • Hexable

Constructors

constructor

new BigNumber(constructorGuard, hex)

Parameters

NameType
constructorGuardany
hexstring

Properties

_hex

Readonly _hex: string


_isBigNumber

Readonly _isBigNumber: boolean

Methods

abs

abs(): BigNumber

Returns

BigNumber


add

add(other): BigNumber

Parameters

NameType
otherBigNumberish

Returns

BigNumber


and

and(other): BigNumber

Parameters

NameType
otherBigNumberish

Returns

BigNumber


div

div(other): BigNumber

Parameters

NameType
otherBigNumberish

Returns

BigNumber


eq

eq(other): boolean

Parameters

NameType
otherBigNumberish

Returns

boolean


fromTwos

fromTwos(value): BigNumber

Parameters

NameType
valuenumber

Returns

BigNumber


gt

gt(other): boolean

Parameters

NameType
otherBigNumberish

Returns

boolean


gte

gte(other): boolean

Parameters

NameType
otherBigNumberish

Returns

boolean


isNegative

isNegative(): boolean

Returns

boolean


isZero

isZero(): boolean

Returns

boolean


lt

lt(other): boolean

Parameters

NameType
otherBigNumberish

Returns

boolean


lte

lte(other): boolean

Parameters

NameType
otherBigNumberish

Returns

boolean


mask

mask(value): BigNumber

Parameters

NameType
valuenumber

Returns

BigNumber


mod

mod(other): BigNumber

Parameters

NameType
otherBigNumberish

Returns

BigNumber


mul

mul(other): BigNumber

Parameters

NameType
otherBigNumberish

Returns

BigNumber


or

or(other): BigNumber

Parameters

NameType
otherBigNumberish

Returns

BigNumber


pow

pow(other): BigNumber

Parameters

NameType
otherBigNumberish

Returns

BigNumber


shl

shl(value): BigNumber

Parameters

NameType
valuenumber

Returns

BigNumber


shr

shr(value): BigNumber

Parameters

NameType
valuenumber

Returns

BigNumber


sub

sub(other): BigNumber

Parameters

NameType
otherBigNumberish

Returns

BigNumber


toBigInt

toBigInt(): bigint

Returns

bigint


toHexString

toHexString(): string

Returns

string

Implementation of

Hexable.toHexString


toJSON

toJSON(key?): any

Parameters

NameType
key?string

Returns

any


toNumber

toNumber(): number

Returns

number


toString

toString(): string

Returns

string


toTwos

toTwos(value): BigNumber

Parameters

NameType
valuenumber

Returns

BigNumber


xor

xor(other): BigNumber

Parameters

NameType
otherBigNumberish

Returns

BigNumber


from

Static from(value): BigNumber

Parameters

NameType
valueany

Returns

BigNumber


isBigNumber

Static isBigNumber(value): value is BigNumber

Parameters

NameType
valueany

Returns

value is BigNumber